package response

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func Response(ctx *gin.Context, httpStatus int, code int, msg string, data interface{}) {
	ctx.JSON(httpStatus, gin.H{
		"code": code,
		"msg":  msg,
		"data": data,
	})
}
func Success(ctx *gin.Context, code int, msg string, data interface{}) {
	Response(ctx, http.StatusOK, code, msg, data)
}
func BadRequest(ctx *gin.Context, code int, msg string, data interface{}) {
	Response(ctx, http.StatusBadRequest, code, msg, data)
}
